#pragma once

#include <utility>
#include <vector>

namespace solution_048
{

class Solution
{
public:
    void rotate(std::vector<std::vector<int>>& matrix)
    {
        const int n = matrix.size();
        for (int row = 0; row < n / 2; ++row)
            std::swap(matrix.at(row), matrix.at(n - row - 1));
        for (int row = 0; row < n; ++row) {
            for (int col = 0; col < row; ++col)
                std::swap(matrix.at(row).at(col), matrix.at(col).at(row));
        }
    }
};

}  /* namespace solution_048 */
